import { pubRequire } from '@utils/public'
const baseUrl = '/lives/streamers'
/*查询主播列表*/
export function getAnchorList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/*封禁主播*/
export function patchLiveStreamerClose(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj.id}/close`,
    obj,
    callbBack,
    errBack
  )
}
/*解禁主播*/
export function patchLiveStreamerOpen(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj.id}/open`,
    obj,
    callbBack,
    errBack
  )
}
/*主播认证通过*/
export function putLivesVerfyings(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}
/*新增主播*/
export function postAnchor(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}

/*认证身份*/
export function patchLiveStreamerIdentification(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj.id}/identification`,
    obj,
    callbBack,
    errBack
  )
}

/*修改直播的分类*/
export function patchLiveStreamerLiveType(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj.id}/live-type`,
    obj,
    callbBack,
    errBack
  )
}
/*查询主播数据*/
export function getAnchorDetail(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `/lives/statistics/streamers`,
    obj,
    callbBack,
    errBack
  )
}
// 总数
export function getTotalApi(callbBack, errBack) {
  return pubRequire('get', `/lives/statistics/total`, {}, callbBack, errBack)
}
// 查询某天的数据
export function searchByDay(obj, callbBack, errBack) {
  return pubRequire('get', `/lives/statistics/by-day`, obj, callbBack, errBack)
}
// 查询某项数据列表
export function searchListApi(obj, callbBack, errBack) {
  return pubRequire('get', `/lives/statistics/by`, obj, callbBack, errBack)
}
// 某段时间统计数据
export function getSomeTimesData(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `/lives/statistics/by-day-stage`,
    obj,
    callbBack,
    errBack
  )
}
